Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
OK - I'm running my chat software inside a general threads page. They have upgraded their system which will allow me to pass a username through to the chat software.

The header of my page is like this:
code:
// Require the library
require ("main.inc.php");
$user[U_Username] = $w3t_myname;
$user[U_Password] = $w3t_mypass;

// ---------------------
// Send the page to them
$html = new html;
$html -> send_header("The Chat Room",$Cat,0,$user);

$html -> table_header("The Chat Room");

$phpurl = $config[phpurl];

$html -> open_table();
echo "



then my chat stuff goes after the echo statement. The line with the password is like this:

code:
<PARAM NAME="Username" VALUE="$user[U_Username]">


I've tried it with $user[U_Username] and with $w3t_myname

also have tried escaping out <? ?> around the password variable.

Am I missing something simple? Anyone have any idea?

Thanks in advance.

Sponsored Links
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
This should work:
code:

<?

// Require the library
require ("main.inc.php");
$userob = new user;
$user = $userob -> authenticate();
$Username = $user['U_Username'];
$Password = $user['U_Password'];

// ---------------------
// Send the page to them
$html = new html;
$html -> send_header("The Chat Room",$Cat,0,$user);
$html -> table_header("The Chat Room");
$phpurl = $config[phpurl];
$html -> open_table();
echo "
<PARAM NAME="Username" VALUE="$Username">
";

?>


Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Gardener,

I've said it before!
You're Awesome! This worked perfectly.
Thank you!
Josh

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
As always it's nice to be able to help. =]

Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Hi there,

I wanted to do a similar thing to my chat application. Josh was kind enough to point me to this forum from the main ubb one.

I have added a link at the top menu for users to click (for the chat module). The code that you guys describe here will be in a new PHP page, right? By including the main.inc.php one ensures that one has the use of functions/variables and with the full script one gets the user name and password.

What if I need to get some more information. Can I modify the authenticate() function to allow for another field to be used or will I have to hit the database again from this script?

Finally, I want this page to be launched in a new window and to execute an APPLET in it. I know how to do these things in ASP but as far as PHP is concerned I am in total darkness. There is a small java script that allows you to open a url (with any parameters) in a new window, so I can use that function.

I wish for the user to click on the chat link and a new window to open. This will ensure that the user has access to the forum. Once the new window opens, the checks are done and the applet initialized. I was thinking of the below php page:

code:


<?
// Require the library
require ("main.inc.php");
$userob = new user;
$user = $userob -> authenticate();
$Username = $user['U_Username'];
$RealEmail = $user['U_Email']; //Sorry I have to check the database for this one
$Name = $user['U_Name'];
$Homepage = $user['U_Homepage'];
$NewField = $user['U_NewField']; // A new field that I added for my chat application




Now here it becomes blurry. I want to execute the following:

code:

<APPLET NAME="MyChat"
CODEBASE="http://www.mydomain.com/Chat/Classes/"
CODE="another.new.class"
WIDTH="200"
HEIGHT="100"
ALIGN="MIDDLE"
ARCHIVE="something.jar">
<PARAM NAME="username" VALUE="$Username">
<PARAM NAME="name" VALUE="$Name">
<PARAM NAME="homepage" VALUE="$Homepage">
<PARAM NAME="realemail" VALUE='$RealEmail'>
<PARAM NAME="newfield" VALUE='$NewField'>
</APPLET>






Any help is more than appreciated.

Warm regards

Nikos


Nikos
Sponsored Links
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
This is what you should do:
code:

<?
// Require the library
require ("main.inc.php");
$userob = new user;
$user = $userob -> authenticate("U_Email, U_Homepage, U_NewField, U_Name");
$Username = $user['U_Username'];
$RealEmail = $user['U_Email']; //Sorry I have to check the database for this one
$Name = $user['U_Name'];
$Homepage = $user['U_Homepage'];
$NewField = $user['U_NewField']; // A new field that I added for my chat application
echo <<<UBBTPRINT
<APPLET NAME="MyChat"
CODEBASE="http://www.mydomain.com/Chat/Classes/"
CODE="another.new.class"
WIDTH="200"
HEIGHT="100"
ALIGN="MIDDLE"
ARCHIVE="something.jar">
<PARAM NAME="username" VALUE="$Username">
<PARAM NAME="name" VALUE="$Name">
<PARAM NAME="homepage" VALUE="$Homepage">
<PARAM NAME="realemail" VALUE='$RealEmail'>
<PARAM NAME="newfield" VALUE='$NewField'>
</APPLET>
UBBTPRINT;
?>



You see that you can add fields from the users table to the authenticate function, some are added automatically, like Username.

Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Thanks a million Gardener! I will try it as soon as I get home! Hopefully I will have a huge success smile on my face tonight!

Thanks once more

Nikos


Nikos

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Shock Hosting
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Ruben Rocha
Ruben Rocha
Lutz,FL,USA
Posts: 253
Joined: January 2000
Forum Statistics
Forums63
Topics37,583
Posts293,955
Members13,824
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 435
Topics Created 0
Posts Made 0
Users Online 1
Birthdays 18
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)